<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title>cookie</title>
    <script>
        window.onload=function(ev){
            // document.cookie="key=value";
            document.cookie="age=33;";//浏览器关闭过期
            document.cookie="age=33;expires="+date.toGMTString()+";";//明年过期
            document.cookie="age=33;path=/;domain=127.0.0.1";
            alert(document.cookie);
        }
    </script>

</head>

<body>


</body>

</html>